package se.olli.jonsered;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

public class AboutActivity extends Activity implements OnClickListener {
	private TextView website, fb;
	private Intent web_link, fb_link;
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.about);

		website = (TextView) findViewById(R.id.webpage);
		fb = (TextView) findViewById(R.id.fb);
		
		website.setOnClickListener(this);
		fb.setOnClickListener(this);

		web_link = new Intent();
		fb_link = new Intent();
		web_link.setAction(Intent.ACTION_VIEW);
		web_link.addCategory(Intent.CATEGORY_BROWSABLE);
		web_link.setData(Uri.parse("http://jonseredsskattkammare.blogspot.se/"));
		fb_link.setAction(Intent.ACTION_VIEW);
		fb_link.addCategory(Intent.CATEGORY_BROWSABLE);
		fb_link.setData(Uri.parse("https://www.facebook.com/Jonseredsskattkammare"));

	}

	public void onClick(View v) {
		if(v.getId() == website.getId()) {
			startActivity(web_link);
		} else if (v.getId() == fb.getId()) {
			startActivity(fb_link);
		}
			
	}

}
